Home Reference Source Test
public class | source

BGMapMapBox

Extends:

BGMapWrapper → BGMapMapBox

MapBox as background map provider.

See:

Constructor Summary

Public Constructor
public

Creates an instance of BGMapWrapper.

Method Summary

Public Methods
public

Add click event.

public

addEventListener(eventstr: string, eventfunction: Function): void

Adds a listener to a specified event type.

public

Add Pan/Drag event.

public

Add zoom event.

public

createCanvas(id: number): HTMLElement

Given one id it creates a canvas object.

public

Returns the background map object.

public

Returns the latitude of the bounding box northwest corner.

public

Returns the longitude of the bounding box northwest corner.

public

getContainer(): HTMLElement

Returns the map's containing HTML element.

public

Returns the height of the canvas element.

public

Returns the width of the canvas elment.

public

Returns the map's current zoom level.

Inherited Summary

From class BGMapWrapper
public

This is the background map object that comes from the background map provider(e.g., MapBox).

public

loaderDiv: HTMLDivElement

The div that contains the loader.

public

Add click event.

public

addEventListener(eventstr: string, eventfunction: Function): void

Adds a listener to a specified event type.

public

Add Pan/Drag event.

public

Add zoom event.

public

createCanvas(id: number): HTMLElement

Given one id it creates a canvas object.

public

createLoader(): void

Auxiliar method to be called when there is no loader and we want to create one.

public

Returns the background map object.

public

Returns the latitude of the bounding box northwest corner.

public

Returns the longitude of the bounding box northwest corner.

public

getContainer(): HTMLElement

Returns the map's containing HTML element.

public

Returns the height of the canvas element.

public

Returns the width of the canvas elment.

public

Returns the map's current zoom level.

public

showLoader(): void

Shows loader at the beginning when the API is loading the data.

Public Constructors

public constructor(bgmap: Object) source

Creates an instance of BGMapWrapper.

Override:

BGMapWrapper#constructor

Params:

NameTypeAttributeDescription
bgmap Object

The background map object that came from the provider (e.g., Mapbox, Google Maps).

Public Methods

public addClickEvent(map: Map) source

Add click event.

Override:

BGMapWrapper#addClickEvent

Params:

NameTypeAttributeDescription
map Map

The function to be called when the user clicks on the map.

public addEventListener(eventstr: string, eventfunction: Function): void source

Adds a listener to a specified event type.

Override:

BGMapWrapper#addEventListener

Params:

NameTypeAttributeDescription
eventstr string

The event type to add a listen for.

eventfunction Function

The function to be called when the event is fired. The listener function is called with the data object passed to fire , extended with target and type properties.

Return:

void

public addPanEvent(fun: Function) source

Add Pan/Drag event.

Override:

BGMapWrapper#addPanEvent

Params:

NameTypeAttributeDescription
fun Function

The function to be called when the user performs drag on the map.

public addZoomEvent(fun: Function) source

Add zoom event.

Override:

BGMapWrapper#addZoomEvent

Params:

NameTypeAttributeDescription
fun Function

The function to be called when the user performs zoom in/out on the map.

public createCanvas(id: number): HTMLElement source

Given one id it creates a canvas object.

Override:

BGMapWrapper#createCanvas

Params:

NameTypeAttributeDescription
id number

The id of the canvas to be created.

Return:

HTMLElement

Canvas object where everything will be drawn.

TODO:

  • Understand case mapbox comment bellow.

public getBackgroundMapProviderObject(): bgMapObject source

Returns the background map object. This is the Background provider object (e.g., Mapbox, GMaps, HereMaps, Bing Maps).

Override:

BGMapWrapper#getBackgroundMapProviderObject

Return:

bgMapObject

the background map object.

public getCenterLat(): number source

Returns the latitude of the bounding box northwest corner.

Override:

BGMapWrapper#getCenterLat

Return:

number

Latitude of northwest corner, measured in degrees.

public getCenterLng(): number source

Returns the longitude of the bounding box northwest corner.

Override:

BGMapWrapper#getCenterLng

Return:

number

Longitude of northwest corner, measured in degrees.

public getContainer(): HTMLElement source

Returns the map's containing HTML element.

Override:

BGMapWrapper#getContainer

Return:

HTMLElement

The map's HTML element container.

public getHeight(): number source

Returns the height of the canvas element.

Override:

BGMapWrapper#getHeight

Return:

number

the height of the canvas elment.

public getWidth(): number source

Returns the width of the canvas elment.

Override:

BGMapWrapper#getWidth

Return:

number

the width of the canvas elment.

public getZoom(): number source

Returns the map's current zoom level.

Override:

BGMapWrapper#getZoom

Return:

number

The map's current zoom level.